using QAssetBundle;
using UnityEngine;
using UnityEngine.UI;
using QFramework;
using UnityEngine.SceneManagement;

namespace ProjectSurvival
{
    public class GameStartPanelData : UIPanelData
    {
    }

    public partial class GameStartPanel : UIPanel, IController
    {
        ResLoader _resLoader = ResLoader.Allocate();

        protected override void OnInit(IUIData uiData = null)
        {
            mData = uiData as GameStartPanelData ?? new GameStartPanelData();
            // please add init code here

            //点金币升级后显示金币升级系统面板
            btnCoinUpgrade.onClick.AddListener((() =>
            {
                AudioKit.PlaySound(Buttonclick_wav.ButtonClick);
                CoinUpgradePanel.gameObject.SetActive(true);
            }));

            //开始游戏
            btnGameStart.onClick.AddListener(() =>
            {
                AudioKit.PlaySound(Buttonclick_wav.ButtonClick);
                CloseSelf();
                SceneManager.LoadScene("GameScene");
            });
            btnAchievement.onClick.AddListener(() =>
            {
                AudioKit.PlaySound(Buttonclick_wav.ButtonClick);
                AchievementPanel.Show();
            });
        }

        protected override void OnOpen(IUIData uiData = null)
        {
        }

        protected override void OnShow()
        {
        }

        protected override void OnHide()
        {
        }

        protected override void OnClose()
        {
        }

        public IArchitecture GetArchitecture()
        {
            return Global.Interface;
        }
    }
}